<?php
/**
 * Created by PhpStorm.
 * User: haobin
 * Date: 2016/11/14
 * Time: 16:25
 * description:广告展开记录
 */
require('../conn.php');
require('../functions.php');
$adUrl = $mysql->query("select * from `link` where type = 2");
$url = "http://".$adUrl[0]['link']."/weiApp/downloads.php";
if($_GET){
    $ad['platform'] = $_GET['platform'];
    $ad['uid'] = $_GET['uid'];
    $ad['aid'] = $_GET['aid'];
    $ad['fromurl'] = $_SERVER['HTTP_REFERER'];
    $ad['day'] = date("Y-m-d",time());
    $ad['time'] = date("H:i:s",time());
    $ad['money'] = 20;
    $ad['ip'] = GetIP();
    $ad['location'] = $_GET['type'];
    $res = $mysql->execute("insert into adpv".arr2s($ad));
    if($res){
        header("Location:$url");
    }
}
